package com.bigfire.dtm.domain.ability.aggregate;

public interface ICompetenceModel {
    //全局常量
    double allTaskNum = 100;
    double allProgrammerNum = 34;
    double allTechNum = 9;
    double allTrainNum = 6;


    //个人产出常量
    double normalDoneEfficiency = 0.5;
    double normalDoneRate = 0.5;
    double normalInRate = 0.1;
    double normalDelayRate = 1;
    double normalQuality = 0.5;

    //个人费用常量
    double normalFee = 18000;
    double normalLevel = 6;
    double normalFeeLevelRate = 1;

    //个人意愿常量
    double normalBuzRate = 1;
    double normalTechEfficiency = 0.8;

    //个人能力常量
    double normalCapacity = 1;


    //组合胜任力
    double getCompetenceOutputValue();

    double getCompetenceFeeRateValue();

    double getCompetenceWishValue();

    double getCompetenceCapabilityValue();

    double getCompetenceGrowValue();

    //原子胜任力
    double getDoneEfficiencyValue();

    double getDoneRateValue();

    double getInRateValue();

    double getDelayRateValue();

    double getQualityValue();

    double getFeeRateValue();

    double getBuzRateValue();

    double getTechEfficiencyValue();

    double getCapabilityValue();

    default double getDoneEfficiencyValue(double inTime, double inNum) {
        double rate = inTime / inNum;
        return normalDoneEfficiency - rate;
    }

    default double getDoneRateValue(double inDoneNum, double inReceiveNum) {
        double rate = inDoneNum / inReceiveNum;
        return rate - normalDoneRate;
    }

    default double getInRateValue(double inReceiveNum, double inAllNum) {
        double rate = inReceiveNum / inAllNum;
        return rate - normalInRate;
    }

    default double getDelayRateValue(double inTime, double inNum) {
        double rate = inTime / inNum;
        return normalDelayRate - rate;
    }

    default double getQualityValue(double inTime, double inNum) {
        double rate = inTime / inNum;
        return normalQuality - rate;
    }

    default double getFeeRateValue(double inFee, double inLevel) {
        double feeLevel = inFee / inLevel;
        //归一化
        double feeLevelRate = feeLevel / (normalFee / normalLevel);

        return normalFeeLevelRate - feeLevelRate;
    }

    default double getBuzRateValue(double inRealTime, double inCapacity) {
        double rate = inRealTime / inCapacity;
        return rate - normalBuzRate;
    }

    default double getTechEfficiencyValue(double inEffectTime, double inRealTime) {
        double rate = inEffectTime / inRealTime;
        return rate - normalTechEfficiency;
    }

    default double getCapabilityValue(double inCapacity) {
        return inCapacity - normalCapacity;
    }

}
